package utils;

import java.util.Collection;
import java.util.Iterator;

public class InputValidator {
    public static boolean isNullOrBlank(String val) {
        return val == null || val.length() == 0;
    }

    public static boolean isNullOrBlank(Long val){
        return val == null;
    }
     public static boolean isNullOrBlank(Collection allElement) {

        if (allElement == null || allElement.isEmpty())
            return true;

        for (Iterator iterator = allElement.iterator(); iterator.hasNext();) {
            Object element = iterator.next();

            if (element instanceof String) {
                if (!InputValidator.isNullOrBlank((String) element))
                    return false;
            } else {
                if (element != null)
                    return false;
            }

        }

        return true;
    }
}
